<?php
/**
 * Created by PhpStorm.
 * User: jucai002
 * Date: 2019/1/21
 * Time: 15:55
 */

namespace backend\controllers;


use yii\base\Module;
use yii\web\Controller;

class AdminController extends Controller
{
    public $enableCsrfValidation = false;
    public $layout = false;

    public function beforeAction($action)
    {
        parent::beforeAction($action);

        //除登录
        $s = $_SERVER;
        if ($s['REQUEST_URI'] == '/login/login') {
            return true;
        }
        if(empty($_SESSION['log'])){
            $this->redirect(\Yii::$app->urlManager->createUrl(['login/login', true]));
        }
        return true;
    }


    public function actionHead()
    {
        return $this->render('//admin/head');
    }
}